feat(results): add audit metadata to results endpoint - #56
Open
pgreat123 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #38
Summary
Adds an audit-friendly
metadataobject to theGET /api/results/:ballotIdresponse, alongside a simpleresultsByLabelmap ({ "Option A": 45 }) matching the issue's example. Frontend now displays this metadata on the public results page.Changes
backend/src/routes/results.ts— addedmetadataobject (ballot_id, ballot_title, total_votes, tally_timestamp, stellar_transaction_id, is_consistent, encryption_note) andresultsByLabelbackend/src/tests/results.test.ts— coverage for metadata fields and accuracyfrontend/src/pages/ResultsPage.tsx— displays metadata, consistency badge, collapsible encryption note, Stellar transaction linkfrontend/src/types/index.ts— updated types for the new response shapeNote for reviewers
While rebasing onto the latest
main, I found thatbackend/src/services/emailService.tsandbackend/src/routes/votes.tscurrently fail to compile withtsc(missing closing brace before thesendVoterTokenEmaildoc comment, and a mismatchedtry/catchblock). This is unrelated to this PR — confirmed present directly onmainviagit show app-upstream/main:...before any of my changes. It will block builds/CI for this and other open PRs until fixed. Flagging here rather than bundling an unrelated fix into this PR.